package jp.co.cos.ittrick.channel.controller.inquiry;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class IndexController extends Controller {

    @Override
    public Navigation run() throws Exception {

    	UserService userService = UserServiceFactory.getUserService();
    	String thisURL = request.getRequestURI();

		if(!userService.isUserLoggedIn()) {
			String loginUrl = userService.createLoginURL(thisURL);
			requestScope("loginFlg", false);
			requestScope("loginUrl", loginUrl);

		}else {
			requestScope("loginFlg", true);
		}


        return forward("index.jsp");
    }
}
